package dp;

public class _22_121_买卖股票的最佳时机_暴力超时 {
    public int maxProfit(int[] prices) {

    	int dp[] = new int[prices.length];
    	int res = 0; 
    	for(int i = 1; i < prices.length; i++) {
    		for(int j = 0; j <= i; j++) {
    			dp[i] = Math.max(dp[i], prices[i] - prices[j]);
    		}
    		res = Math.max(res, dp[i]);
    	}
    	
    	return res;
    }
    
    public static void main(String[] args) {
    	int prices[] = {0};
		System.out.println(new _22_121_买卖股票的最佳时机_暴力超时().maxProfit(prices));
	}
}
